package com.blue.controller;


import com.blue.VO.Result;
import com.blue.entity.Line;
import com.blue.service.LineService;
import com.blue.service.StationService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author blue
 * @since 2024-11-25
 */
@Controller
@RequestMapping("/station")
public class StationController {
    @Autowired
    StationService stationService;


    @RequestMapping("/{id}")
    public Result showLine(@PathVariable("id") int id){
        List<Line> lines = stationService.findLines(id);
        if(lines == null){
           return Result.fail(404,"出错了,站id不存在");
        }
        return Result.success(lines);
    }
}

